package com.zhouyu.service;

import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.stereotype.Component;

/**
 * @author leimingchao
 * create 2025-05-03 20:30
 */
//@Component
public class ZhouyuMergedBeanDefinitionPostProcessor implements MergedBeanDefinitionPostProcessor {

	@Override
	public void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class<?> beanType, String beanName) {

		if ("userService".equals(beanName)) {

			//beanDefinition.setInitMethodName("a");
			OrderService orderService = new OrderService();

			System.out.println("BeanDefinition====" + orderService);

			//beanDefinition.getPropertyValues().add("orderService", orderService);
		}

		//if ("productService".equals(beanName)) {
		//
		//	beanDefinition.setDestroyMethodName("b");
		//}

	}
}
